# -*- Mode: Python; indent-tabs-mode: nil -*-

from t0_ber import *

def HD(s):
    return s.decode ('hex')

data = HD('300602016302016e')
p = Pair()
p.decode (data)
print p.encode().encode('hex')

tests = [
    HD('6110300e020203e90101ff30003003020101'),
    HD('611230100204400000000101ff30003003020101'),
    HD('6110300e020203e901010030003003020101'),
    HD('61133011020203e901010030003006020101020102'),
    HD('61133011020203e901010030030101ff3003020101'),
    HD('61163014020203e901010030060101ff0101003003020101'),
    HD('603c303a040361626302013202022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101000a0100'),
    HD('603c303a040361626302013302022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101000a0100'),
    HD('603c303a040361626302013402022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101ff0a0100'),
    HD('603c303a040361626302013202022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101000a0101'),
    HD('603c303a040361626302013302022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101000a0101'),
    HD('603c303a040361626302013402022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101ff0a0101'),
    HD('603c303a040361626302013202022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101000a0102'),
    HD('603c303a040361626302013302022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101000a0102'),
    HD('603c303a040361626302013402022711020417bc927a3020300602010a020165300602010a020165300602010a020165300602010a0201650101ff0a0102'),
]

for data in tests:
    m = ThingMsg()
    m.decode (data)
    print m.value
